package com.vote.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * The persistent class for the house database table.
 * 
 */
@Entity
@Table(name = "ANSWER_INFO")
public class AnswerInfo implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -643540927558909294L;
	private Long id;
	private String ip;
	private String cookie;
	private String part;
	private Date createTime;	
	private Date updateTime;
	
	private QuestionInfo questionInfo;	
	private QuestionOpt questionOpt;
	private Respondent respondent;
		
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ID")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	@Column(name = "CREATE_TIME")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "UPDATE_TIME")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@Column(name = "IP")
	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	@Column(name = "COOKIE")
	public String getCookie() {
		return cookie;
	}

	public void setCookie(String cookie) {
		this.cookie = cookie;
	}

	@ManyToOne
	@JoinColumn(name = "INFO_ID")
	public QuestionInfo getQuestionInfo() {
		return questionInfo;
	}

	public void setQuestionInfo(QuestionInfo questionInfo) {
		this.questionInfo = questionInfo;
	}

	@ManyToOne
	@JoinColumn(name = "OPT_ID")
	public QuestionOpt getQuestionOpt() {
		return questionOpt;
	}

	public void setQuestionOpt(QuestionOpt questionOpt) {
		this.questionOpt = questionOpt;
	}

	@ManyToOne
	@JoinColumn(name = "RESP_ID")
	public Respondent getRespondent() {
		return respondent;
	}

	public void setRespondent(Respondent respondent) {
		this.respondent = respondent;
	}

	@Column(name = "PART")
	public String getPart() {
		return part;
	}

	public void setPart(String part) {
		this.part = part;
	}
	
	
	
}